<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增我的请款')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-fund-add"  th:object="${workRequestFund}">
            <div class="form-group">
                <input name="papers" th:field="*{papers}" type="hidden">
                <label class="col-sm-3 control-label">联系人：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input type="text" th:field="*{contacts}" class="form-control" name="contacts" id="contacts" required disabled>
                        <input name="contactId" id="contactId" type="hidden" th:field="*{contactId}" >
                        <div class="input-group-btn">
                            <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-right" role="menu">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">请款总额：</label>
                <div class="col-sm-8">
                    <input name="fundAmount" th:field="*{fundAmount}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">请款银行：</label>
                <div class="col-sm-8">
                    <select name="bankName" class="form-control m-b" th:with="type=${@dict.getType('work_bank')}" disabled>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{bankName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">银行账号：</label>
                <div class="col-sm-8">
                    <input name="bankAccount" th:field="*{bankAccount}" class="form-control" type="text" disabled>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "work/fund"
        $("#form-fund-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-fund-add').serialize());
            }
      /*     if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-fund-add').serialize(),function (result){
                    if(result.code==0) {
                        var parent = activeWindow();
                        if (parent.table.options.type == table_type.bootstrapTable) {
                            parent.submitfund(result.data);
                        }
                    }
                    else {
                        parent.submitfund(0,result.msg);
                    }
                });
            }*/

        }

        $("input[name='requestTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        /* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
        function getSelections() {
            //return $.table.selectFirstColumns();
            if ($.validate.form()) {debugger
                var txt = $.operate.save(prefix + "/add", $('#form-fund-add').serialize());
                return txt;
            }

        }
    </script>
</body>
</html>